]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
main: move pointer-sync-on-restack code here
authorDan Winship <danw@gnome.org>
Fri, 10 Jun 2011 13:51:55 +0000 (09:51 -0400)
committerDan Winship <danw@gnome.org>
Fri, 24 Jun 2011 20:08:00 +0000 (16:08 -0400)
We call global.sync_pointer() on MetaScreen::restack as a hack to try
to fix up the hover state after a pointer grab. Previously we were
doing this in chrome.js, since there was already a ::restack handler
there anyway, but this isn't really related to the chrome at all, so
move it to main.js instead.

https://bugzilla.gnome.org/show_bug.cgi?id=633620

js/ui/chrome.js
js/ui/main.js

index 27779fcf32f817a73d2a7adf5670dab2582cd6c8..32b8f04f426f1903b2f59ffdeaab5d7dfd2264a1 100644 (file)
@@ -335,11 +335,6 @@ Chrome.prototype = {
             this._updateVisibility();
             this._queueUpdateRegions();
         }
-
-        // Figure out where the pointer is in case we lost track of
-        // it during a grab. (In particular, if a trayicon popup menu
-        // is dismissed, see if we need to close the message tray.)
-        global.sync_pointer();
     },
 
     _updateRegions: function() {
index c0f48451a0a841ac7dd2d1c58125573a6ee2c564..43fcfa5b7acc5d7bb99b2e72afcc284b4d1707aa 100644 (file)
@@ -208,6 +208,7 @@ function start() {
 
     global.screen.connect('window-entered-monitor', _windowEnteredMonitor);
     global.screen.connect('window-left-monitor', _windowLeftMonitor);
+    global.screen.connect('restacked', _windowsRestacked);
 
     _nWorkspacesChanged();
 }
@@ -310,6 +311,13 @@ function _windowEnteredMonitor(metaScreen, monitorIndex, metaWin) {
         _queueCheckWorkspaces();
 }
 
+function _windowsRestacked() {
+    // Figure out where the pointer is in case we lost track of
+    // it during a grab. (In particular, if a trayicon popup menu
+    // is dismissed, see if we need to close the message tray.)
+    global.sync_pointer();
+}
+
 function _queueCheckWorkspaces() {
     if (_checkWorkspacesId == 0)
         _checkWorkspacesId = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, _checkWorkspaces);